package dao;

import java.util.List;

import model.Position;

public class PositionDao extends BaseDao<Position> {

	public List<Position> getAll(){
		String hql = "FROM Position";		
		return getSession().createQuery(hql).list();
	}
	
	public void saveOrUpdate(Position p){
		getSession().saveOrUpdate(p);
	}
	
	
	public void delete(Integer id){
		String hql = "DELETE FROM Position p WHERE p.id = ?";
		getSession().createQuery(hql).setInteger(0, id).executeUpdate();
	}
	
}
